import axios from "axios";
import React, { use, useState, useDeferredValue, useMemo } from "react";
import './index.scss'
import List from "./20-List";

function App() {

    const [str, setStr] = useState('')


    // 延期更新数据
    const deferredValue = useDeferredValue(str)

    const memoList = useMemo(() => {
        return <List str={deferredValue}></List>
    }, [deferredValue])


    return <div>
        <h1>App</h1>
        <input value={str} onChange={e => setStr(e.target.value)} type="text" name="" id="" />
        {memoList}
        {/* <List str={str}></List> */}
    </div>
}


export default App